﻿@{
     Layout = "_mainLayout.cshtml";

     var db = Database.Open("EPS");
       var sqlCommand="SELECT * FROM awaitingPoll";
       List<awaitingPoll>lst=new List<awaitingPoll>();

       foreach(var row in db.Query(sqlCommand))
       {
           awaitingPoll temp= new awaitingPoll();
           temp.pollid = row.pollid.ToString();
           temp.desc = row.desc.ToString();
           temp.op1 = row.op1.ToString();
           temp.op2 = row.op2.ToString();
           temp.op3 = row.op3.ToString();
           temp.agelimit = row.agelimit.ToString();
           temp.pollcity = row.pollcity.ToString();
           temp.pollcountry = row.pollcountry.ToString();
           temp.pollgender = row.pollgender.ToString();
           
           
           lst.Add(temp);
           
       }
}

<!DOCTYPE html>

<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>EPS - Awaiting Polls</title>
    </head>
    <body>
        <div>

            <ul>
                
                  @{
                      for(int i=0;i<lst.Count;i++)
                      {
                           var s ="apppoll.cshtml?pid=" +lst[i].pollid.ToString();
                          
                              <li>
                                   
                            
                               <p> Poll ID : <strong>@lst[i].pollid</strong></p>
                               <p> Description : <strong>@lst[i].desc</strong></p>
                               <p> Option 1 : <span>@lst[i].op1</span><br /></p>
                               <p> Option 2 : <span>@lst[i].op2</span><br /></p>
                               <p> Option 3 : <span>@lst[i].op3</span><br /></p>
                               <p> Age Limit : <span>@lst[i].agelimit</span><br /></p> 
                               <p> Poll City : <span>@lst[i].pollcity</span><br /></p>
                               <p> Poll Country : <span>@lst[i].pollcountry</span><br /></p>
                               <p> Poll Gender : <span>@lst[i].pollgender</span><br /></p>

                                Approve Poll : <a href="@Href("~/apppoll.cshtml", @s)" style ="font-size: 15px;color: #0094ff">  Yes </a>  
                                        <a href="@Href("~/declinepoll.cshtml", @s)" style ="font-size: 15px;color: #0094ff">  No </a><br/><br/>
                              
                                  
                              </li>
                           }
                       }
               
                </ul>
        </div>


        <div>
            <a href="~/EPSHomePage.cshtml" style="color: #0094ff">Go to Home Page</a>
        </div>
        
    </body>
</html>
